package com.andy.service.impl;

import com.andy.service.LoginService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {


    @Override
    public void login(String username, String password) throws Exception {

        //校验入参
        if (StringUtils.isBlank(username) || StringUtils.isBlank(password)) {
            throw new RuntimeException("账户密码不能为空");
        }

        if ("admin".equals(username) && "admin".equals(password)) {
            System.out.println("密码验证通过");
        } else {
            throw new RuntimeException("密码错误");
        }
    }
}
